package com.flyoil.petromp.utils.OrderUtl;

import com.flyoil.petromp.R;

/**
 * Created by songzhiyin on 2017/10/31.
 * 单据列表的工具类
 */

public class OrderListUtil {
    /**
     * 采购计划
     */
    public static final String PLAN = "物资采购计划单";
    /**
     * 物资采购需求
     */
    public static final String GOODS_DEMAND = "物资采购需求单";
    /**
     * 物资采购审批
     */
    public static final String GOODS_APPROVE = "物资采购审批单";
    /**
     * 物资订单
     */
    public static final String GOODS_ORDER = "物资采购订单";
    /**
     * 物资验收单
     */
    public static final String GOODS_EXAMINE = "物资验收单";
    /**
     * 物资质保期验收单
     */
    public static final String GOODS_DATE_EXAMINE = "物资质保期验收评定单";
    /**
     * 服务需求
     */
    public static final String SERVICE_DEMAND = "服务需求单";
    /**
     * 服务审批
     */
    public static final String SERVICE_APPROVE = "服务审批单";
    /**
     * 服务订单
     */
    public static final String SERVICE_ORDER = "服务订单";
    /**
     * 服务验收
     */
    public static final String SERVICE_EXAMINE = "服务验收单";
    /**
     * 财务
     */
    public static final String FINANCE = "项目付款单";
    /**
     * 供应商
     */
    public static final String REPERTORY_SUPPLIER = "供应商审批单";
    /**
     * 服务
     */
    public static final String REPERTORY_SERVICE = "服务供应商审批单";
    /**
     * 产品
     */
    public static final String REPERTORY_PRODUCT = "供应商物品审批单";

    /**
     * 根据单据的类型返回对应的图片资源文件
     *
     * @param orderType
     * @return
     */
    public static int getImageResource(String orderType) {
        int imageResource = R.mipmap.order_list_cgjh_icon;

        switch (orderType) {
            case PLAN://采购计划
                imageResource = R.mipmap.order_list_cgjh_icon;
                break;
            case GOODS_DEMAND://物资采购
            case GOODS_APPROVE:
            case GOODS_ORDER:
            case GOODS_EXAMINE:
            case GOODS_DATE_EXAMINE:
                imageResource = R.mipmap.order_list_wzcg_icon;
                break;
            case SERVICE_DEMAND://服务采购
            case SERVICE_APPROVE:
            case SERVICE_ORDER:
            case SERVICE_EXAMINE:
                imageResource = R.mipmap.order_list_fwcg_icon;
                break;
            case FINANCE://财务类
                imageResource = R.mipmap.order_list_cwl_icon;
                break;
            case REPERTORY_SUPPLIER://供应商
            case REPERTORY_SERVICE://服务
            case REPERTORY_PRODUCT://物品
                imageResource = R.mipmap.order_list_gys_icon;
                break;
        }
        return imageResource;
    }
}
